import requests from './request'

//获取用户列表
export const getUserList=()=>{
    return requests({ url:'api/user1/selectAll',method:'get'});
}
//电话查找用户
export const getUser = (tel) => {
    return requests({ url: `api/user1/select`, method: 'post', data: {'tel':tel}, });
}
//登录
export const getLogin = (data) => {
    return requests({ url: 'api/Admin/login', data: { 'adminId':data.userName,'adminPassword':data.password }, method: 'post' });
}
//获取派送员列表
export const getdList = () => {
    return requests({ url: 'api/paisong/selectAll', method: 'get' });
}
//更新派送员
export const updatedUser = (tel) => {
    return requests({ url: `api/paisong/update`, method: 'post', data: { id:values.id,'dName': values.name, 'dTel': values.tel }, });
}
//电话查找派送员
export const getdUser = (tel) => {
    return requests({ url: `api/paisong/select`, method: 'post', data: { 'dTel': tel }, });
}
//添加派送员
export const addUser = (values) => {
    return requests({ url: `api/paisong/add`, method: 'post', data: { 'dName': values.name ,'dTel': values.tel }, });
}
//删除派送员
export const delUser = (values) => {
    console.log(values)
    return requests({ url: `api/paisong/delete`, method: 'post', data: {'id': values }, });
}
//获取车辆列表
export const getcarList = () => {
    return requests({ url: 'api/car/selectAll', method: 'get' });
}
//车牌查找车辆
export const getcar = (values) => {
    return requests({ url: `api/car/select`, method: 'post', data: { 'cId': values }, });
}
//添加车辆
export const addcar = (values) => {
    return requests({ url: `api/car/add`, method: 'post', data: { 'cId': values.cId, 'carcolor': values.carcolor, 'carquality': values.carquality } , });
}
//删除车辆
export const delcar = (values) => {
    console.log(values)
    return requests({ url: `api/car/delete`, method: 'post', data: { 'cId': values }, });
}

//获取路线列表
export const getpathList = () => {
    return requests({ url: 'api/path/selectAll', method: 'get' });
}
//站点查找路线
export const getpath = (values) => {
    return requests({ url: `api/path/select`, method: 'post', data: { 'pass': values }, });
}
//添加路线
export const addpath = (values) => {
    return requests({ url: `api/path/add`, method: 'post', data: { 'pId': values.pId, 'pState': values.pState, 'pass': values.pass, 'pName': values.pName }, });
}
//删除路线
export const delpath = (values) => {
    console.log(values)
    return requests({ url: `api/path/delete`, method: 'post', data: { 'pId': values }, });
}
//订单下单排序
export const getorderlist1 = () => {
    return requests({ url: 'api/morder', method: 'get' });
}
//订单预约排序
export const getorderlist2 = () => {
    return requests({ url: 'api/aorder', method: 'get' });
}
//订单运输排序
export const getorderlist3 = () => {
    return requests({ url: 'api/morder2', method: 'get' });
}
//订单完成排序
export const getorderlist6 = () => {
    return requests({ url: 'api/aorder3', method: 'get' });
}
export const carlist = () => {
    return requests({ url: 'api/getall', method: 'get' });
}



